import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp,
	ref
} from 'vue'

import {
	createPinia
} from 'pinia'

import {
	useUserStore
} from '@/store'
import utils from '@/utils/util.js'

import config from '@/config/config.js'
const isSlidingBack = ref(false); // 用于跟踪左滑后退状态
// import gridLayout from 'vue-grid-layout'
import {
	api
} from '@/api/api.js' // API 链接
export function createApp() {
	const app = createSSRApp(App)
	app.use(createPinia())
	// app.use(gridLayout)
	//配置全局变量
	app.config.globalProperties.$utils = utils;
	app.config.globalProperties.$config = config;
	app.config.globalProperties.$tips = "该功能未开通，后续会陆续更新！";
	app.config.globalProperties.$api = api;
	app.config.globalProperties.$isSlidingBack = isSlidingBack;
	// 自定义过滤器
	app.config.globalProperties.$filters = {
	  // 示例过滤器，将字符串转换为大写
	  uppercase(value) {
	    return value.toUpperCase();
	  }
	};
	return {
		app
	}
}
// #endif